package com.wayhome.srpingbootmybatis.boc.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.wayhome.srpingbootmybatis.boc.consts.BocOnePayConst;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class BocQueryRefundOrdRespDTO {

    @ApiModelProperty(value = "原支付方式", notes = "ZFBA-支付宝 WEIX-微信 UPAY-银联二维码(暂不支持) DZZF-电子支付 UN-未知")
    @JsonProperty("OldPayType")
    public String OldPayType;

    @ApiModelProperty(value = "原交易编码", notes = "201001支付宝消费201002微信消费201012电子支付消费")
    @JsonProperty("OldTranId")
    public String OldTranId;

    @ApiModelProperty(value = "原唯一流水号")
    @JsonProperty("OldPayLs")
    public String OldPayLs;

    @ApiModelProperty(value = "原交易金额", notes = "金额以分为单位不包含小数，不足 12 位左补“0”:000000000001，代 表1分钱")
    @JsonProperty("OldTranAmt")
    public String OldTranAmt;

    @ApiModelProperty(value = "交易币种", notes = "固定填156")
    @JsonProperty("OldCcyCode")
    public String OldCcyCode;

    @ApiModelProperty(value = "响应码", notes = "本笔查询交易的结果代码")
    @JsonProperty("RespCode")
    public String RespCode;

    @ApiModelProperty(value = "响应信息", notes = "本笔查询交易的结果描述")
    @JsonProperty("RespMsg")
    public String RespMsg;

    @ApiModelProperty(value = "柜员号")
    @JsonProperty("OperNo")
    public String OperNo;

    @ApiModelProperty(value = "原交易响应信息", notes = "当RespCode等于成功时有此域返回")
    @JsonProperty("OldRespCode")
    public String OldRespCode;

    @ApiModelProperty(value = "原交易结果描述", notes = "当RespCode等于成功时有此域返回")
    @JsonProperty("OldRespMsg")
    public String OldRespMsg;

    @ApiModelProperty(value = "原银行交易日期")
    @JsonProperty("OldBankDate")
    public String OldBankDate;

    @ApiModelProperty(value = "原银行交易时间")
    @JsonProperty("OldBankTime")
    public String OldBankTime;

    @ApiModelProperty(value = "支付宝交易单号，当OldPayType=ZFBA时返回本域")
    @JsonProperty("OldTradeNo")
    public String OldTradeNo;

    @ApiModelProperty(value = "原第三方交易单号", notes = "当OldPayType=DZZF时返回本域 ")
    @JsonProperty("OldOthTradeNo")
    public String OldOthTradeNo;

    @ApiModelProperty(value = "原银联付款凭证号", notes = "当OldPayType=UNPAY时返回本域 ")
    @JsonProperty("OldPayVounum")
    public String OldPayVounum;


    @ApiModelProperty(value = "原银联支付订单号", notes = "当OldPayType=UNPAY时返回本域 ")
    @JsonProperty("OldPayNo")
    public String OldPayNo;

    @ApiModelProperty(value = "原终端流水号")
    @JsonProperty("OldTraceNo")
    public String OldTraceNo;

    @ApiModelProperty(value = "原商户订单号")
    @JsonProperty("OldOrderNo")
    public String OldOrderNo;

    @ApiModelProperty(value = "原商户退货订单号")
    @JsonProperty("OldRefundOrderNo")
    public String OldRefundOrderNo;

    @JSONField(name="MsgVer")
    @JsonProperty("MsgVer")
    @ApiModelProperty(value = "报文版本")
    public String MsgVer;

    @ApiModelProperty(value = "前端系统日期", notes = "日期格式:yyyyMMdd")
    @JsonProperty("InDate")
    @JSONField(name="InDate")
    public String InDate;

    @ApiModelProperty(value = "前端系统时间", notes = "时间格式:HHmmss")
    @JsonProperty("InTime")
    @JSONField(name="InTime")
    public String InTime;

    @ApiModelProperty(value = "交易编码")
    @JsonProperty("TranId")
    @JSONField(name="TranId")
    public String TranId;

    @ApiModelProperty(value = "业务编号")
    @JsonProperty("BussId")
    @JSONField(name="BussId")
    public String BussId;

    @ApiModelProperty(value = "接入商户类型 01-普通商户 02-第三方支付机构")
    @JsonProperty("MerTp")
    @JSONField(name="MerTp")
    public String MerTp;

    @ApiModelProperty(value = "报文方向", notes = "11 请求/通知报文  12应答报文")
    @JsonProperty("Drctn")
    @JSONField(name="Drctn")
    public String Drctn;

    @ApiModelProperty(value = "商户号", notes = "当storNo(机器/门店号出现时可以不上传")
    @JsonProperty("MerId")
    @JSONField(name="MerId")
    public String MerId;

    @ApiModelProperty(value = "终端号", notes = "当storNo(机器/门店号出现时可以不上传")
    @JsonProperty("TermId")
    @JSONField(name="TermId")
    public String TermId;

    @ApiModelProperty(value = "门店号/机器号")
    @JsonProperty("StorNo")
    @JSONField(name="StorNo")
    public String StorNo;

    @ApiModelProperty(value = "唯一支付流水号")
    @JSONField(name="PayLs")
    @JsonProperty("PayLs")
    public String PayLs;

    @ApiModelProperty(value = "终端流水号", notes = "生成连续的 6 位流水号")
    @JSONField(name="TraceNo")
    @JsonProperty("TraceNo")
    public String TraceNo;

    @ApiModelProperty(value = "批次号", notes = "批次号可以当天日期为一个批次号")
    @JSONField(name="BatchNo")
    @JsonProperty("BatchNo")
    public String BatchNo;

    @ApiModelProperty(value = "外部商户订单号", notes = "请求:如前端系统存在此域则上送;回应:同请求")
    @JsonProperty("MerOrderNo")
    @JSONField(name="MerOrderNo")
    public String MerOrderNo;



    @ApiModelProperty(value = "信息备注", notes = "备注信息商户有需要时上传")
    @JSONField(name="Attach")
    @JsonProperty("Attach")
    public String Attach;

    @ApiModelProperty(value = "签名", notes = "待签名信息由以下格式组成，MerId|TermId|Payls|TraceNo\n" +
            "或者MerId 和 TermId 不存在时采用 StorNo|Payls|TraceNo|TranId")
    @JSONField(name="Sign")
    @JsonProperty("Sign")
    public String Sign;


    public String signStr() {
        return MerId + BocOnePayConst.SIGN_SPLIT + TermId + BocOnePayConst.SIGN_SPLIT + PayLs + BocOnePayConst.SIGN_SPLIT + TraceNo;
    }
}
